<text><span class="style2">his stack provides a demonstration of HyperTint, a set of XCMDs and XFCNs that can be used to add color to HyperCard.
This demo stack is based on the full HyperTint documentation stack that purchasers will receive, but many cards have been deleted from this demo.
The XCMDs and XFCNs in this demo are designed to work only in this demo stack. Some XCMDs and XFCNs, including </span><span class="style1"><a href="#" class="group">HTWriteScheme</a></span><span class="style2"> and </span><span class="style1"><a href="#" class="group">HTRClear</a></span><span class="style2">, are not included in this demo. As well, XCMD options that are not required by the scripts in this stack have been disabled.
The copyright banner at the top of the card window appears only in the demo version.</span></text>
</content>
<content>
<layer>background</layer>
<id>10</id>
<text>HyperTint Overview</text>
</content>
<content>
<layer>background</layer>
<id>8</id>
<text>
HTWriteScheme
HTRClear
</text>
</content>
<content>
<layer>background</layer>
<id>9</id>
<text>
8205
6017
</text>
</content>
<name>About This Demo</name>
<script></script>
</card>
card_7847.xml
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
<text><span class="style2">yperTint is a set of XCMDs and XFCNs that are used to add color to HyperCard 2.x stacks. These commands have all sorts of weird and wonderful options to make life easier for the HyperTalk scripter or to handle some special cases.
</span><span class="style2">The </span><span class="style22"><a href="#" class="group">XCMD Reference</a></span><span class="style2"> section contains detailed information on each HyperTint command or function. All those weird and wonderful options are described in this section. Example cards are sprinkled through this section to demonstrate the use of the commands.
Most of the cards in this section have been removed from this demo, but a few of the command descriptions and example cards are left.
</span><span class="style21">Notes and Tips</span><span class="style2">
The </span><span class="style22"><a href="#" class="group">Notes and Tips</a></span><span class="style2"> section has tips on making HyperTint easier to use and ways to handle problems that may occur. It also provides information about how this stack makes use of HyperTint.
Most of the cards in this section have been removed from this demo, but we've tried to keep the cards that can help buyers gauge the usefulness of HyperTint.
The </span><span class="style22"><a href="#" class="group">About HyperTint …</a></span><span class="style2"> section contains information about how how to order HyperTint and how to contact Symplex Systems.
This section of the ΓÇ£fullΓÇ¥ HyperTint documentation stack also discusses the telephone and e-mail technical support available to purchasers.
</span></text>
</content>
<content>
<layer>background</layer>
<id>8</id>
<text>
XCMD Reference
Notes and Tips
About HyperTint …
</text>
</content>
<content>
<layer>background</layer>
<id>9</id>
<text>
6550
8686
18735
</text>
</content>
<content>
<layer>background</layer>
<id>10</id>
<text>HyperTint Overview</text>
</content>
<name>An Overview of This Stack</name>
<script></script>
</card>
card_25077.xml
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
<text><span class="style24">ow to Navigate Through This Stack</span></text>
</content>
<content>
<layer>background</layer>
<id>6</id>
<text><span class="style2">he arrow buttons at the top of the card will allow you to move through the stack linearly. This is the recommended route on the first journey through the stack.
The buttons on the title card jump to the start of each section. Each section starts with section content cards which list all the cards in that section. Clicking on one of the names in the list will jump to that card.
Two menus provide an alternative way to navigate. The ΓÇ£TopicsΓÇ¥ menu allows jumping between sections or between cards in each section. The contents of this menu change, depending on the current section. The current section will have a ΓÇ£ΓÇóΓÇ¥ placed beside its menu item. The current card will have a checkmark placed next to it. Selecting a menu item jumps directly to that card.
The ΓÇ£RecentΓÇ¥ menu keeps track of the last 15 cards visited. Selecting a menu item will jump back to one of the recent cards.
Some cards have additional buttons that link to other cards. HyperCard's ΓÇ£hot textΓÇ¥ feature can be used to jump to related topics. Hot text can be recognized, because it is underlined </span><span class="style22"><a href="#" class="group">like this</a></span><span class="style2">. </span><span class="style12">Demo note: because this demo version does not contain all the cards in the real HyperTint stack, most of the hot text links have been removed from the demo</span><span class="style2">.</span></text>
</content>
<content>
<layer>background</layer>
<id>10</id>
<text>HyperTint Overview</text>
</content>
<content>
<layer>background</layer>
<id>8</id>
<text>
like this
</text>
</content>
<content>
<layer>background</layer>
<id>9</id>
<text>
S answer "This is just an example. It doesn't go anywhere."
</text>
</content>
<name>How to Navigate Through T</name>
<script></script>
</card>
card_6822.xml
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
<text>HyperTint provides a set of XCMDs for adding color to HyperCard 2.0/2.1. Some of its features are:
ΓÇó A color picture can be displayed in HyperCard's card window. This picture coexists with the display produced by HyperCard: HyperCard's paint, buttons, and fields are overlaid on top of the color picture. Because the color image is not detected by HyperCard, no trickery is required to pass mouse clicks through to buttons and fields.
ΓÇó Different sections of the card can be assigned individual foreground and background colors, so that colored buttons and fields can be simulated.
ΓÇó Color visual effects are supported so that users are provided with familiar visual cues when exploring a stack.
ΓÇó The implementation is optimized so that stacks with complex color layouts can be supported without placing an undue performance burden on those stacks with simple color requirements.
ΓÇó A quick way of quickly switching between color layouts is supported.
ΓÇó HyperCard's text handling is optimized so that typing and scrolling speeds are still acceptable, even with the additional overhead of color.
ΓÇó If a backdrop color picture is not required, HyperTint can reduce its memory requirements but still support the assignment of foreground and background colors to various sections of the screen.</text>
</content>
<content>
<layer>background</layer>
<id>10</id>
<text>HyperTint Overview</text>
</content>
<name>HyperTint Features</name>
<script></script>
</card>
card_6946.xml
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
<text>An important aspect of HyperTint is its support for backdrop pictures. HyperCard already supports the concept of a background image (with paint, buttons, and fields) and a card image (with more paint, buttons, and fields). The card image is overlaid on top of the background to produce the final screen display that is shown to the user. HyperCard allows portions of the card image to be either transparent or opaque. For this discussion, we will use the term ΓÇ£HyperCard imageΓÇ¥: this is the image that is displayed on the screen, after HyperCard has overlaid the card on the background and accounted for the opaque and transparent sections of the card.
HyperTint adds a new layer: the backdrop layer. The backdrop is placed beneath the background image. After HyperCard works its magic to produce the HyperCard image, HyperTint takes the HyperCard image and lays it over the backdrop picture. By default, HyperTint treats the entire HyperCard image as transparent: the backdrop picture will ΓÇ£show throughΓÇ¥ wherever the HyperCard image has white pixels.
Through the use of color regions, discussed later, it is also possible to specify that portions of the HyperCard image should be treated as opaque, with any desired background color.
This combined image, with the HyperCard image overlaid on the backdrop, is displayed in the card window. If the window is moved or a change is made, the color image automatically updates itself.
</text>
</content>
<content>
<layer>background</layer>
<id>10</id>
<text>HyperTint Overview</text>
</content>
<name>Backdrops</name>
<script></script>
</card>
card_2430.xml
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
<text><span class="style2">o invoke HyperTint for a stack window, the </span><span class="style1"><a href="#" class="group">HyperTint</a></span><span class="style2"> command is used. The HyperTint command requires the name or number of a picture (PICT) resource that will be used as the backdrop picture. For instance,
HyperTint 1254
would look for a picture with a resource ID 1254 to use as the stack's backdrop. The call to install HyperTint in the current card window would normally be contained in the stack's </span><span class="style7">openStack </span><span class="style2">handler.
The backdrop picture being used can be changed using the </span><span class="style1"><a href="#" class="group">HTChangePict</a></span><span class="style2"> command. For instance,
</span><span class="style2">will use the PICT resource named ΓÇ£Image 2ΓÇ¥ as the new backdrop image. This will usually be done when switching between backgrounds which use different backdrop pictures, although it can be done when switching between cards (or at any other time).
There is also a command </span><span class="style1"><a href="#" class="group">HTAddPict</a></span><span class="style2"> that allows adding a picture on top of the existing backdrop, replacing only a specified rectangle in the backdrop picture. The picture being added can be clipped to the size of the rectangle specified or scaled to fit the rectangle.
To turn off colorization, use the command </span><span class="style12">HTRemove. </span><span class="style2">No parameters are required. This is usually done as part of the stack's </span><span class="style7">closeStack</span><span class="style2"> handler.
There are also options that allow the picture to be read from a PICT file or to perform colorization of the card without a backdrop picture, which allows a substantial memory savings.
</span></text>
</content>
<content>
<layer>background</layer>
<id>8</id>
<text>
HyperTint
HTChangePict
HTAddPict
</text>
</content>
<content>
<layer>background</layer>
<id>9</id>
<text>
3747
8801
12330
</text>
</content>
<content>
<layer>background</layer>
<id>10</id>
<text>HyperTint Overview</text>
</content>
<name>Colorizing with HyperTint</name>
<script></script>
</card>
card_6017.xml
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
<text><span class="style2">yperTint also allows the scripter to specify colors for various buttons, for paint text, or for the text in a field. This is done by adding rectangles to ΓÇ£color regions.ΓÇ¥
A color region consists of one or more rectangles (or rounded rectangles) specifying sections of the card. A background and a foreground color can be specified for each color region. Any pixel in a color region that uncolorized HyperCard would display as white will instead be displayed as the background color for that region. Any pixel in a color region that uncolorized HyperCard would display as black will instead be displayed as the foreground color for that region. HyperTint can support up to 10 color regions, although there is a performance penalty for each additional region used.
The background color can also be set to ΓÇ£</span><span class="style22"><a href="#" class="group">transparent</a></span><span class="style2">ΓÇ¥. This allows placing colored text and graphics over the backdrop picture: instead of a solid background color, the backdrop picture would show through wherever uncolorized HyperCard would display white.
Regions will often consist of only a single rectangle, but each region can contain multiple rectangles, scattered anywhere over the card.
HyperTint commands include features that make it easy to match color regions to buttons and fields, but it is important to realize that HyperTint really doesn't know anything about buttons and fields. It deals only in raw rectangle coordinates. "3,32,437,275" may be the rectangle for this field, but if I move the field, HyperTint does not notice the change. It will merrily keep on colorizing the rectangle "3,32,437,275" until I invoke the commands that remove the old field rectangle from the region and add the new rectangle.
This is also important if buttons or fields are dynamically hidden or shown: in addition to hiding or showing the field, it is necessary to also include the commands that will remove or add the field's rectangle from the appropriate color region. The XCMD Reference section of this stack has some ΓÇ£</span><span class="style22"><a href="#" class="group">showing/hiding</a></span><span class="style2">ΓÇ¥ examples. The Notes and Tips section has ideas to </span><span class="style22"><a href="#" class="group">reduce the hassles of changing color layouts</a></span><span class="style2">.
The commands that deal with color regions all start with the letters HTR (for ΓÇ£HyperTint RegionΓÇ¥). The first parameter is always a number between 1 and 10 that indicates which color region will be affected. The remaining parameters depend on the command. The commands are described in detail in the XCMD Reference section of this stack.
Each color region can have its foreground and background colors specified:
Color regions are built ΓÇ£on the fly.ΓÇ¥ Each color region starts off empty, with nothing. An empty region causes very little performance penalty. There are two commands to add areas to the color regions. HTRAddRect adds rectangles and HTRAddRRect adds rounded corner rectangles (which match HyperCard's ΓÇ£round rectangleΓÇ¥ button type.)
</span><span class="style2">To make easier to deal with buttons and fields, these commands have options to adjust the coordinates that are passed. This makes it easier to choose, for instance, whether a field should have its border colorized.
Areas can also be removed from the colorized regions:
</span><span class="style2">HTRSubRect and HTRSubRRect are the counterparts to HTRAddRect and HTRAddRRect: these commands could be used when hiding a </span><span class="style22"><a href="#" class="group">popup field</a></span><span class="style2"> or a </span><span class="style22"><a href="#" class="group">button</a></span><span class="style2">. HTRClear provides a fast way of removing everything from a color region so that it is once again empty: this command commonly would be used when leaving a card whose scripts have dynamically added areas to a separate color region.
This card contains three color regions. The text in this field is contained in one region. The title at the top is in another region. The two arrow buttons belong to a third region.
By the way, I'm a programmer, not a graphic artist. If you think the colors chosen create the ugliest thing ever seen in this universe, the Notes and Tips section describes a button panel, invoked by the command </span><span class="style26"><a href="#" class="group">cc</a></span><span class="style2">, which allows interactively trying out new colors. Disclaimer: while the button panel is my creation, I take no responsibility for the aesthetic violence cause by inappropriate use of this tool.</span></text>
</content>
<content>
<layer>background</layer>
<id>8</id>
<text>
cc
transparent
showing/hiding
reduce the hassles of changing color layouts
popup field
button
</text>
</content>
<content>
<layer>background</layer>
<id>9</id>
<text>
15926
S demoTransparent
S DemoShowHide
5160
S demoShowHide
S demoButtonHide
</text>
</content>
<content>
<layer>background</layer>
<id>10</id>
<text>HyperTint Overview</text>
</content>
<name>Color Regions</name>
<script>on demoTransparent
-- This script jumps to the title card and switches
-- the buttons so that they are transparent
-- Keep track of where the user was reading
put the scroll of field "Doc" into saveScroll
push card
go first card
put HTRCurrBC(1) into saveBackcolor
HTRBackground 1,"transparent","noDelay"
repeat
if HTRCurrBC(1) is "transparent" then
put "The buttons on this card have been made transparent."¬
& " Notice how the picture shows through." into prompt
else
put "The buttons now have their original gray background."¬
into prompt
end if
answer prompt with "Gray" or "Transparent" or "Go back"
if it is "Gray" then
HTRBackground 1,saveBackcolor,"noDelay" -- put back the old color
else if it is "Transparent" then
HTRBackground 1,"transparent","noDelay" -- make it transparent again
else
exit repeat
end if
end repeat
pop card
set the scroll of field "Doc" to saveScroll
end demoTransparent
on demoShowHide
put the scroll of field "Doc" into saveScroll
go to card "Color region examples"
send mouseup to button "Show Popup"
wait 30 ticks
send mouseDown to card field "popup"
wait 30 ticks
go back
set the scroll of field "Doc" to saveScroll
end demoShowHide
on demoButtonHide
put the scroll of field "Doc" into saveScroll
go to card (char 1 to 25 of "Button and Field Visual Effect Examples")
send mouseup to button "Button Blend"
wait 15 ticks
go back
set the scroll of field "Doc" to saveScroll
end demoButtonHide</script>
</card>
card_8205.xml
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
<text><span class="style2">s the color layouts get more elaborate, with more buttons and fields being colorized, the time required for a script to create the color layouts increases. Users do not like having to wait for a couple of seconds when jumping between backgrounds or cards. To provide a fast method of changing color layouts, HyperTint added the concept of color schemes. A color scheme records the current backdrop picture being used, as well the areas of the card window belonging to each color region and the foreground and background colors assigned to each color region. A new color scheme can be installed with a single command, </span><span class="style12">HTColorScheme</span><span class="style2">. Color schemes are stored as resources in the stack's resource file.
When authoring a stack, the current color layout can be saved as a color scheme by using the command </span><span class="style12">HTWriteScheme</span><span class="style2">. This command will create a color scheme resource that will be saved in the stack's resource file.
</span></text>
</content>
<content>
<layer>background</layer>
<id>8</id>
<text>
</text>
</content>
<content>
<layer>background</layer>
<id>9</id>
<text>
</text>
</content>
<content>
<layer>background</layer>
<id>10</id>
<text>HyperTint Overview</text>
</content>
<name>Color Schemes</name>
<script></script>
</card>
card_9289.xml
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
<text><span class="style2">he bad news is that HyperCard's visual effects are incompatible with HyperTint. During visual effects, HyperCard draw directly to the screen which makes it rather hard for HyperTint to works its magic.
The good news is that HyperTint provides its own visual effects, using the </span><span class="style1"><a href="#" class="group">HTVisual</a></span><span class="style2"> command so that colorized stacks can still provide the expected visual cues.
Multiple visual effects can be ΓÇ£stacked up,ΓÇ¥ just as with HyperCard's own effects. The visual effects can be restricted to a rectangle of the card, if desired. In addition to providing an effect transition to the new card image, colors can also be specified.
All the options for controlling effects are described in the XCMD Reference entry for </span><span class="style1"><a href="#" class="group">HTVisual</a></span><span class="style2">. The ΓÇ£</span><span class="style22"><a href="#" class="group">Visual Effects Examples</a></span><span class="style2">ΓÇ¥ card demonstrates the effects for card to card transitions.
</span></text>
</content>
<content>
<layer>background</layer>
<id>8</id>
<text>
HTVisual
example card
Visual Effects Examples
</text>
</content>
<content>
<layer>background</layer>
<id>9</id>
<text>
14255
24485
24485
</text>
</content>
<content>
<layer>background</layer>
<id>10</id>
<text>HyperTint Overview</text>
</content>
<name>Visual Effects</name>
<script>on closeCard
-- Rather silly, eh? How's your beer?
put the rect of this card into effectRect
put item 3 of effectRect div 2 into item 3 of effectRect
put item 4 of effectRect div 2 into item 4 of effectRect
HTVisual "scroll right","65535,0,0",effectRect,0
put the rect of this card into effectRect
put item 3 of effectRect div 2 into item 1 of effectRect
put item 4 of effectRect div 2 into item 2 of effectRect
HTVisual "scroll left","0,65535,0",effectRect,0
put the rect of this card into effectRect
put item 3 of effectRect div 2 into item 1 of effectRect
put item 4 of effectRect div 2 into item 4 of effectRect
HTVisual "scroll up","65535,65535,0",effectRect,0
put the rect of this card into effectRect
put item 3 of effectRect div 2 into item 3 of effectRect
put item 4 of effectRect div 2 into item 2 of effectRect
HTVisual "scroll down","0,0,65535",effectRect,0
if the optionKey is down then
HTVisual "iris open"
else
put the rect of this card into effectRect
put item 3 of effectRect div 2 into item 3 of effectRect
put item 4 of effectRect div 2 into item 4 of effectRect
HTVisual "scroll right","card",effectRect,0
put the rect of this card into effectRect
put item 3 of effectRect div 2 into item 1 of effectRect
put item 4 of effectRect div 2 into item 2 of effectRect
HTVisual "scroll left","card",effectRect,0
put the rect of this card into effectRect
put item 3 of effectRect div 2 into item 1 of effectRect
put item 4 of effectRect div 2 into item 4 of effectRect
HTVisual "scroll up","card",effectRect,0
put the rect of this card into effectRect
put item 3 of effectRect div 2 into item 3 of effectRect
put item 4 of effectRect div 2 into item 2 of effectRect
HTVisual "scroll down","card",effectRect,0
end if
-- hide card field test
pass closeCard
end closeCard
</script>
</card>
card_8003.xml
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
<text><span class="style2">creen updates when using HyperTint require a lot more processing. This is very noticeable when typing new characters into a field or when scrolling a field ΓÇ£page by page.ΓÇ¥
To overcome this problem, HyperTint includes optimizations to improve keystroke and text scrolling performance.
These optimizations try to perform their magic in a safe way, but ΓÇö for those users who are leery of potential compatibility problems ΓÇö there is an option that can be used when invoking </span><span class="style22"><a href="#" class="group">HyperTint</a></span><span class="style2"> that will prevent these optimizations from being installed.</span></text>
</content>
<content>
<layer>background</layer>
<id>8</id>
<text>
HyperTint
</text>
</content>
<content>
<layer>background</layer>
<id>9</id>
<text>
3747
</text>
</content>
<content>
<layer>background</layer>
<id>10</id>
<text>HyperTint Overview</text>
</content>
<name>Text Optimizations</name>
<script></script>
</card>
card_10960.xml
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
<text><span class="style2">yperTint is based on a set of XCMDs that have to be called from scripts. Admittedly, this is less user-friendly than a set of interactive tools. Still, there are techniques that can reduce the hassles inherent in such an approach. Before plunging into using HyperTint on a full-scale project, be sure to have a look at the techniques discussed in the Notes and Tips section of this stack, in particular the ΓÇ£</span><span class="style22"><a href="#" class="group">Moving Things Around</a></span><span class="style2">ΓÇ¥ and the ΓÇ£</span><span class="style22"><a href="#" class="group">Assigning Colors Interactively</a></span><span class="style2">ΓÇ¥ card. The pain is not eliminated ΓÇö only a full-fledged color version of HyperCard will do that ΓÇö but the process becomes more tolerable.</span></text>
</content>
<content>
<layer>background</layer>
<id>8</id>
<text>
Moving Things Around
Assigning Colors Interactively
</text>
</content>
<content>
<layer>background</layer>
<id>9</id>
<text>
5160
15926
</text>
</content>
<content>
<layer>background</layer>
<id>10</id>
<text>HyperTint Overview</text>
</content>
<name>Making Authoring Easier</name>
<script></script>
</card>
card_7198.xml
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
<text><span class="style2">yperTint requires HyperCard 2.0/2.1. It also requires a color-capable Macintosh.
HyperTint may perform better if 32-Bit QuickDraw is installed. Under System 7, 32-Bit QuickDraw is always present on any color Macintosh. As well, all color machines since the Mac IIci have 32-Bit QuickDraw stored in the ROM; these machines always run 32-BIt QuickDraw, even under System 6. For the Macintosh II, IIx, IIcx, IIfx (??), and SE/30, 32-Bit QuickDraw can be installed by dragging the 32-Bit QuickDraw system extension (INIT) file to the system folder and rebooting the machine. HyperTint should run properly even if 32-Bit QuickDraw is not installed, but performance may be slower.
The </span><span class="style12">dither</span><span class="style2"> option in the </span><span class="style1"><a href="#" class="group">HyperTint</a></span><span class="style2">, </span><span class="style1"><a href="#" class="group">HTChangePict</a></span><span class="style2">, and </span><span class="style1"><a href="#" class="group">HTAddPict</a></span><span class="style2"> commands is only available when running under 32-Bit QuickDraw. (Don't feel bad: HyperTint dithering is too slow to be anything more than a curiosity.)
Most of the testing of HyperTint has been done under System 7 version of 32-Bit QuickDraw.</span></text>
</content>
<content>
<layer>background</layer>
<id>8</id>
<text>
HyperTint
HTChangePict
HTAddPict
</text>
</content>
<content>
<layer>background</layer>
<id>9</id>
<text>
3747
8801
12330
</text>
</content>
<content>
<layer>background</layer>
<id>10</id>
<text>HyperTint Overview</text>
</content>
<name>System Requirements</name>
<script></script>
</card>
card_7508.xml
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
<text><span class="style2">he memory requirements for HyperTint are substantial. Two memory buffers are required to hold offscreen copies of the color image displayed. For a given stack, the memory requirements would be approximately:
This stack is 448 pixels wide and 280 pixels tall. The memory required for buffers to display this stack on a 256-color (8 bit) monitor would be
(((8) * 2 +1) * 280 * 448) / 8
which is about 270 kilobytes. This does not include the memory that is needed to read in picture resources and the memory temporarily used by QuickDraw when drawing a new picture. The size of the picture resource might vary from about ten up to hundreds of kilobytes, depending on how much compression QuickDraw was able to perform on the images. When drawing a bitmapped picture (that is, a scanned image or a picture produced by a ΓÇ£paintΓÇ¥ program), QuickDraw allocates an additional offscreen image buffer to hold the bitmap. The good news is that the HyperCard 2.x programming team seems to have done a good job with memory management issues: HyperCard is quite gracious in handling the temporary requests for oodles of memory when changing pictures.
For a stack such as this one, a MultiFinder memory partition of 1400-1500K is recommended. That should give HyperCard lots of memory for buffers and whatever else it needs to optimize its performance. I have actually run this stack plus a colorized version of the Home stack in a 1600K partition.
To reduce memory requirements, various actions can be taken. One is to use smaller card sizes. Another is to use the colorization features but to skip the backdrop picture. Finally, the offscreen buffers can be configured to support fewer colors. Installing HyperTint without a backdrop or with fewer colors is described in the documentation for the </span><span class="style22"><a href="#" class="group">HyperTint</a></span><span class="style2"> command. The </span><span class="style22"><a href="#" class="group">effect on memory requirements and on performance</a></span><span class="style2"> are discussed in the Notes and Tips section.
</span></text>
</content>
<content>
<layer>background</layer>
<id>10</id>
<text>HyperTint Overview</text>
</content>
<content>
<layer>background</layer>
<id>8</id>
<text>
HyperTint
effect on memory requirements and on perfomance
effect on memory requirements and on performance
</text>
</content>
<content>
<layer>background</layer>
<id>9</id>
<text>
3747
25328
25328
</text>
</content>
<name>Memory Requirements</name>
<script></script>
</card>
card_6550.xml
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
The HyperTint command installs HyperTint into the current stack window.
The HyperTint command must be called before all other HyperTint commands or functions. The exception to this rule is that the utility command and functions (which start with the letters ΓÇ£</span><span class="style22"><a href="#" class="group">HTU</a></span><span class="style2">ΓÇ¥) may be called even if HyperTint is not installed.
The parameter specifies the name or number of a picture resource (resource type 'PICT'). This is the picture that will be used as the initial color backdrop. Instead of a picture resource specifier, this parameter can also be set to the keywords </span><span class="style12">none</span><span class="style2"> or </span><span class="style12">later</span><span class="style2">.
The keyword </span><span class="style12">none</span><span class="style2"> indicates that no picture backdrop will be used. The commands to change the background and foreground colors for various regions of the card will still work. This option is useful if solid color regions are sufficient. Using this option eliminates the need for one offscreen buffer which reduces the memory requirement by almost half for pixel depths of 8 or greater. Once this option is specified, there is no way to create the buffer for the backdrop picture without removing and reinstalling HyperTint.
The keyword </span><span class="style12">later</span><span class="style2"> indicates that a picture backdrop will be used, but the picture will be left blank for now. This option is useful because often the backdrop picture changes for each background in the stack. In this case, the call to the HyperTint XCMD can be placed in the </span><span class="style7">openStack</span><span class="style2"> handler, using the </span><span class="style12">later</span><span class="style2"> keyword. Then each background can use a </span><span class="style7">openBackground</span><span class="style2"> handler which uses the </span><span class="style1"><a href="#" class="group">HTChangePict</a></span><span class="style2"> command to select the picture appropriate to that background.
</span><span class="style2">Various optional parameters can be specified to influence the effect of the HyperTint command.
The keyword </span><span class="style12">file</span><span class="style2"> can be used to specify that the picture parameter represents the name of a PICT file rather than a picture resource. The HyperTint command will search the directories listed in the ΓÇ£Search for DocumentsΓÇ¥ card of HyperCard's Home stack. If the file is not found, the user will be prompted to select the file via the standard File Open dialog box.
If the keyword </span><span class="style12">delay</span><span class="style2"> is specified, updates to the screen will be locked until a call is made to </span><span class="style12">HTLock</span><span class="style2"> to unlock the screen. (The effect is the same as an implicit call to </span><span class="style7">HTLock on</span><span class="style2">.) This option allows doing more initialization ΓÇö establishing color regions or specifying visual effects for the initial update ΓÇö before the color image is sent to the screen.
In order to limit the memory requirements of HyperTint, there are keywords to limit the maximum pixel depth used for offscreen buffers: </span><span class="style12">maxDepth1</span><span class="style2">, </span><span class="style12">maxDepth2</span><span class="style2">, </span><span class="style12">maxDepth4</span><span class="style2">, </span><span class="style12">maxDepth8</span><span class="style2">, </span><span class="style12">maxDepth16</span><span class="style2">, and </span><span class="style12">maxDepth32</span><span class="style2">. Normally, HyperTint will allocate offscreen buffers with a pixel depth (that is, the number of bits used for each pixel) that matches the screen on which the card window is displayed. This can require a lot of memory, particularly on displays that support 24/32 bits per pixel (ΓÇ£millions of colorsΓÇ¥). These maxDepth keywords can be used to limit the amount of memory required for HyperTint operation. For instance, if a stack only required 16 colors, maxDepth4 could be specified. Even if the HyperCard stack is displayed on a screen which is set to 256 or more colors, HyperTint will restrict itself to 16 colors for its buffers. There is a significant speed penalty for using this option. HyperTint's operation is much slower when the depth of the offscreen buffers does not match the depth of the screen. In particular, most visual effects tend to become unacceptably slow. If you use these options, you may want to consider turning off all visual effects: see the </span><span class="style12">disallow</span><span class="style2"> keyword for the </span><span class="style1"><a href="#" class="group">HTVisual</a></span><span class="style2"> XCMD. Considering the huge memory requirements of two offscreen 32 bit buffers, it may be a good idea to always specify maxDepth8 unless the stack is being used to handle 32 bit images.
Specifying maxdepth32 is the same as not specifying any maxDepth keyword: HyperTint will attempt to install at the deepest screen depth.
The optional parameter </span><span class="style12">dither</span><span class="style2"> will cause backdrop pictures to be dithered when drawing into the offscreen buffers. Dithering is only done if 32-bit QuickDraw is present. (This is present in the ROM of all color machines except the Mac II, Mac IIx, Mac IIcx, and SE/30: these machines require either the 32-Bit QuickDraw system extension or System 7 to support dithering.) Dithering is only done on bitmapped images. Dithering was originally intended to provide improved image quality when memory limitations required using one of the maxDepthXX keywords, but I think most users will find the speed penalty unacceptable. If </span><span class="style12">dither</span><span class="style2"> is specified when installing HyperTint, the effect is global and does not have to be re-specified each time the picture is changed.
The remaining optional parameters are more obscure. In order to obtain acceptable typing and text scrolling speeds, HyperTint installs patches to optimize HyperCard's text handling. If the keyword </span><span class="style12">NoTEOpt </span><span class="style2">is specified, these optimizations are not installed. To be even more obscure, you can specify </span><span class="style12">TENoCaretOpt</span><span class="style2"> instead of </span><span class="style12">NoTEOpt</span><span class="style2"> which will allow some text optimizations but eliminates other optimizations based on the position of the text insertion caret: try this if fields are not updating properly.
If the installation was successful, HyperCard's </span><span class="style7">the result</span><span class="style2"> function will return an empty string. Other possible results are:
"Requires Color Quickdraw": an attempt was made to install HyperTint on a Mac that does not support color.
"Already installed": an attempt was made to install HyperTint into a stack window that already has HyperTint installed.
"Bad Picture": HyperTint could not find or could not load the picture that was specified. This could be because the picture doesn't exist or due to insufficient memory to read the picture into memory.
"Bad Option": an illegal option was specified.
"Out of Memory": there was insufficient memory to install HyperTint.
</span><span class="style2">If the pixel depth used for the offscreen buffers matches the depth of the screen, the colors available for use will be the same as the colors that were available on the screen when HyperTint was installed. If the pixel depth of the offscreen buffers is less than the screen depth ΓÇö which can only happen if one of the </span><span class="style12">MaxDepthxx</span><span class="style2"> parameters were specified ΓÇö the available colors will be the standard system colors for that pixel depth.
The size of the offscreen buffers is based on the size of the card when HyperTint was installed. HyperTint does not support stacks that change the card size after HyperTint is installed.
In multiple screen configurations, installation is based on the screen or screens that currently display the card window. If the card window is displayed across multiple screens, the colors and pixel depth used are based on the screen with the deepest pixel depth. HyperTint does not automatically support changes to the screen depth ΓÇö caused by changing a setting in the Monitors control panel or by moving the card window to another screen ΓÇö after installation. The script for a stack can remove and reinstall HyperTint if screen depth changes: the ΓÇ£Changing Color DepthΓÇ¥ card in the Notes and Tips section discusses this technique.</span></text>
</content>
<content>
<layer>background</layer>
<id>8</id>
<text>
HTChangePict
HTVisual
HTU
openStack
</text>
</content>
<content>
<layer>background</layer>
<id>9</id>
<text>
8801
14255
25356
21193
</text>
</content>
<content>
<layer>background</layer>
<id>10</id>
<text>XCMD Reference</text>
</content>
<name>HyperTint XCMD</name>
<script></script>
</card>
card_24169.xml
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
Demo note: the HTChangePict XCMD has been included in the demo so that it can be evaluated, but it only allows the picture to be set to ΓÇ£noneΓÇ¥ or to a picture named ΓÇ£BobΓÇ¥. (This ΓÇ£BobΓÇ¥ picture can be either a PICT resource or a PICT file.)
</span><span class="style9">
</span><span class="style2">The parameter specifies the name or number of a picture resource (resource type 'PICT'). This is the picture that will be used as the new color backdrop. Instead of a picture resource specifier, this parameter can also be set to the keyword </span><span class="style12">none</span><span class="style2">.
The keyword </span><span class="style12">none</span><span class="style2"> indicates that no picture backdrop will be used. The commands to change the background and foreground colors for various regions of the card will still work. This option can be used if some backgrounds require a backdrop picture and some don't. Specifying </span><span class="style12">none</span><span class="style2"> does not dispose of the offscreen buffer associated with the backdrop buffer: this buffer is simply ΓÇ£blanked out.ΓÇ¥ (If a backdrop is never required by a stack, then the keyword </span><span class="style12">none</span><span class="style2"> should be specified when calling the </span><span class="style1"><a href="#" class="group">HyperTint</a></span><span class="style2"> XCMD which will eliminate the need for a picture buffer.) HyperTint is able to invoke some speed optimizations when the current backdrop picture is set to </span><span class="style12">none</span><span class="style2">.
</span><span class="style2">The keyword </span><span class="style12">file</span><span class="style2"> can be used to specify that the picture parameter represents the name of a PICT file rather than a picture resource. The HTChangePict command will search the directories listed in HyperCard's ΓÇ£Search for DocumentsΓÇ¥ card. If the file is not found, the user will be prompted to select the file via the standard File Open dialog box.
The keyword </span><span class="style12">dither</span><span class="style2"> can be used to specify that the picture should be dithered as it is drawn into the offscreen buffer. This dithering is only done on bitmapped images. Dithering requires 32-Bit QuickDraw; otherwise, the option is ignored but does not cause an error. Dithering is painfully slow. If </span><span class="style12">dither</span><span class="style2"> was specified when invoking the </span><span class="style1"><a href="#" class="group">HyperTint</a></span><span class="style2"> command, it us not necessary to specify each time HTChangePict is called.</span><span class="style9">
</span><span class="style2">Other optional parameters are the keywords </span><span class="style12">delay</span><span class="style2"> and </span><span class="style12">noDelay</span><span class="style2">. By default, HTChangePict causes an immediate screen update, unless the screen is currently locked. Specifying </span><span class="style12">delay</span><span class="style2"> will cause the screen update to be delayed until HyperCard draws something new to the screen. Specifying </span><span class="style12">noDelay</span><span class="style2"> is redundant: it simply requests that the screen be updated immediately (in other words, the default behaviour). If the screen has been locked using </span><span class="style1"><a href="#" class="group">HTLock</a></span><span class="style2">, neither of these keywords has any effect: no screen updates will occur until the screen is unlocked.
If the command was successful, HyperCard's </span><span class="style7">the result</span><span class="style2"> function will return an empty string. Other possible results are:
"Not Installed": HyperTint is not installed in the current stack.
"Bad Option": An option keyword was not recognized.
"Bad Picture": HyperTint could not find the picture specified or had some problem reading it.
"Out of memory": Increase HyperCard's memory partition or perhaps buy some more RAM
"Error reading file": Something went wrong while reading a PICT file.
"Drawing Error": Something (besides a lack of memory) went wrong when QuickDraw was asked to draw the picture.
"Unknown Error": Something else went wrong.
</span><span class="style9">
</span></text>
</content>
<content>
<layer>background</layer>
<id>8</id>
<text>
HyperTint
</text>
</content>
<content>
<layer>background</layer>
<id>9</id>
<text>
3747
</text>
</content>
<content>
<layer>background</layer>
<id>10</id>
<text>XCMD Reference</text>
</content>
<name>HTChangePict XCMD</name>
<script></script>
</card>
card_12330.xml
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
</span><span class="style12">Demo note: the HTAddPict XCMD has been modified so that it only allows the picture to be set to ΓÇ£noneΓÇ¥ or to a picture named ΓÇ£BobΓÇ¥, which can be either a PICT resource or a PICT file. (As well, the pictures required for use in this demo stack are also supported.)
</span><span class="style2">The parameter specifies the name or number of a picture resource (resource type 'PICT'). This is the picture that will be added. Instead of a picture resource specifier, this parameter can also be set to the keyword </span><span class="style12">none</span><span class="style2">, in which case, the rectangle will be erased.
</span><span class="style2">The keyword </span><span class="style12">file</span><span class="style2"> can be used to specify that the picture parameter represents the name of a PICT file rather than a picture resource. The HTAddPict command will search the directories listed in HyperCard's ΓÇ£Search for DocumentsΓÇ¥ card. If the file is not found, the user will be prompted to select the file via the standard File Open dialog box.
The keyword </span><span class="style12">dither</span><span class="style2"> can be used to specify that the picture should be dithered as it is drawn into the offscreen buffer. This dithering is only done on bitmapped images. Dithering requires 32-Bit QuickDraw; otherwise, the option is ignored but does not cause an error.</span><span class="style9">
</span><span class="style2">The keyword </span><span class="style12">noErase</span><span class="style2"> will keep the rectangle from being erased before the picture is drawn. For bitmap pictures created by a ΓÇ£paintΓÇ¥ program, this option has no visible effect, but it may be useful for some pictures created by ΓÇ£drawΓÇ¥ type programs. The default is to erase before drawing the picture.
By default, the picture's top-left corner will be aligned with the top-left of the rectangle parameter and the picture will be drawn at a 1:1 scale. The drawing is clipped so that nothing is drawn ΓÇ£outside the lines.ΓÇ¥ This default action can be overridden by specifying one of the following keywords.
</span><span class="style12">Scale</span><span class="style2"> will cause the picture to be scaled so that the entire picture will be drawn into the display rectangle.
</span><span class="style12">Center</span><span class="style2"> cause the picture to be drawn at a 1:1 scale, but aligned at the center instead of the top-left. The drawing is clipped to fit the display rectangle.
</span><span class="style12">Restore</span><span class="style2"> will position the top-left of the picture at the top-left of the card, just as would be done for </span><span class="style1"><a href="#" class="group">HTChangePict</a></span><span class="style2">, but only updates the section that falls within the rectangle parameter. This can be used if part of the backdrop picture was modified by a previous HTAddPict command, and it is now desired to restore the original backdrop picture. (Perhaps some other changes — that are still needed — have been made elsewhere to the backdrop and would be lost if HTChangePict was called.) Because the entire picture backdrop picture must still be read and processed, even though only a section is being updated, this is a relatively slow way to restore a section of the picture. A better way would be to create a picture that has a copy of the section to be restored and use the normal HTAddPict to restore the image, but the </span><span class="style12">restore</span><span class="style2"> option is provided as a convenience, particularly during the early stages of stack authoring.
</span><span class="style2">Other optional parameters are the keywords </span><span class="style12">delay</span><span class="style2"> and </span><span class="style12">noDelay</span><span class="style2">. By default, HTAddPict causes an immediate screen update of the rectangle that has been changed, unless the screen is currently locked. Specifying </span><span class="style12">delay</span><span class="style2"> will cause the screen update to be delayed until HyperCard draws something new to the screen. Specifying </span><span class="style12">noDelay</span><span class="style2"> is redundant: it simply requests that the screen be updated immediately (in other words, the default behaviour). If the screen has been locked using </span><span class="style12">HTLock</span><span class="style2">, neither of these keywords has any effect: no screen updates will occur until the screen is unlocked.
If the command was successful, HyperCard's </span><span class="style7">the result</span><span class="style2"> function will return an empty string. Other possible results are:
"Not Installed": HyperTint is not installed in the current stack.
"Bad Option": An option keyword was not recognized.
"Bad Picture": HyperTint could not find the picture specified or had some problem reading it.
"Bad Rectangle": HyperTint was not able to make sense out of the rectangle parameter.
"Out of memory": Increase HyperCard's memory partition or perhaps buy some more RAM
"Error reading file": Something went wrong while reading a PICT file.
"Drawing Error": Something (besides a lack of memory) went wrong when QuickDraw was asked to draw the picture.
</span></text>
</content>
<content>
<layer>background</layer>
<id>8</id>
<text>
HTChangePict
</text>
</content>
<content>
<layer>background</layer>
<id>9</id>
<text>
8801
</text>
</content>
<content>
<layer>background</layer>
<id>10</id>
<text>XCMD Reference</text>
</content>
<name>HTAddPict XCMD</name>
<script></script>
</card>
card_16192.xml
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
-- We'll put the popup into region 9: this way it will
-- be "in front" of the regions used for the buttons.
HTRAddRect 9,the rect of card field "popup", "shadowBorder","field"
show card field "popup"
end mouseUp</script>
</part>
<part>
<id>3</id>
<type>field</type>
<visible> <true /> </visible>
<dontWrap> <false /> </dontWrap>
<dontSearch> <false /> </dontSearch>
<sharedText> <false /> </sharedText>
<fixedLineHeight> <false /> </fixedLineHeight>
<autoTab> <false /> </autoTab>
<lockText> <true /> </lockText>
<rect>
<left>46</left>
<top>176</top>
<right>364</right>
<bottom>210</bottom>
</rect>
<style>transparent</style>
<autoSelect> <false /> </autoSelect>
<showLines> <false /> </showLines>
<wideMargins> <false /> </wideMargins>
<multipleLines> <false /> </multipleLines>
<reservedFamily> 0 </reservedFamily>
<titleWidth>0</titleWidth>
<icon>0</icon>
<textAlign>left</textAlign>
<font>Geneva</font>
<textSize>12</textSize>
<textStyle>plain</textStyle>
<textHeight>16</textHeight>
<name></name>
<script></script>
</part>
<part>
<id>4</id>
<type>button</type>
<visible> <true /> </visible>
<reserved5> 0 </reserved5>
<reserved4> 0 </reserved4>
<reserved3> 0 </reserved3>
<reserved2> 0 </reserved2>
<reserved1> 0 </reserved1>
<enabled> <true /> </enabled>
<rect>
<left>46</left>
<top>152</top>
<right>187</right>
<bottom>174</bottom>
</rect>
<style>shadow</style>
<showName> <true /> </showName>
<highlight> <false /> </highlight>
<autoHighlight> <false /> </autoHighlight>
<sharedHighlight> <true /> </sharedHighlight>
<family>0</family>
<titleWidth>0</titleWidth>
<icon>0</icon>
<textAlign>center</textAlign>
<font>Chicago</font>
<textSize>12</textSize>
<textStyle>plain</textStyle>
<name>Drag Me</name>
<script>on mousedown
-- This script uses region 6 as the "dragging region"
put the mouseV into oldV
put the mouseH into oldH
put the rect of me into startRect
put startRect into baseRect
get the mouseLoc
subtract item 2 of it from item 2 of baseRect
subtract item 2 of it from item 4 of baseRect
subtract item 1 of it from item 1 of baseRect
subtract item 1 of it from item 3 of baseRect
put startRect into newRect
HTRSubRect 1,newRect,shadowNoBorder
repeat while the mouse is down
HTRSubRect 6,newRect,shadowNoBorder
put baseRect into newRect
-- The mouseLoc function is used once instead of
-- individual calls to mouseH and mouseV. This
-- is done because a rapidly moving mouse pointer
-- can change position significantly between
-- script lines.
get the mouseLoc
put item 1 of it into H
put item 2 of it into V
add H to item 1 of newRect
add H to item 3 of newRect
add V to item 2 of newRect
add V to item 4 of newRect
HTRAddRect 6,newRect,shadowNoBorder
set the rect of me to newRect
end repeat
--The choice now is to either put the button back to where it was
-- or to update the color scheme so that the color locations
-- will be right the next time the card is opened. I can't
-- decide, so I'll do it both ways.
if the optionKey is down then
cr -- Call our color assigning routines (WILL NOT WORK IN DEMO VERSION)
else
-- HTRClear 6 -- (HTRClear is not included in the demo version,
-- so use HTRSubRect instead)
HTRSubRect 6,newRect,shadowNoBorder
HTRAddRect 1,startRect,shadowNoBorder
set the rectangle of me to startRect
end if
end mousedown
</script>
</part>
<part>
<id>5</id>
<type>button</type>
<visible> <true /> </visible>
<reserved5> 0 </reserved5>
<reserved4> 0 </reserved4>
<reserved3> 0 </reserved3>
<reserved2> 0 </reserved2>
<reserved1> 0 </reserved1>
<enabled> <true /> </enabled>
<rect>
<left>222</left>
<top>152</top>
<right>364</right>
<bottom>174</bottom>
</rect>
<style>shadow</style>
<showName> <true /> </showName>
<highlight> <false /> </highlight>
<autoHighlight> <false /> </autoHighlight>
<sharedHighlight> <true /> </sharedHighlight>
<family>0</family>
<titleWidth>0</titleWidth>
<icon>0</icon>
<textAlign>center</textAlign>
<font>Chicago</font>
<textSize>12</textSize>
<textStyle>plain</textStyle>
<name>Moving Button</name>
<script>on mousedown
put the rect of me into startRect
put startRect into newRect
HTRSubRect 1,newRect,shadowNoBorder
repeat while location of me is within the rect of this card
HTRSubRect 6,newRect,shadowNoBorder
-- Decide on the new location
subtract 5 from item 1 of newRect
add 15 to item 2 of newRect
subtract 5 from item 3 of newRect
add 15 to item 4 of newRect
HTRAddRect 6,newRect,shadowNoBorder
set the rect of me to newRect
end repeat
-- HTRClear 6 -- (HTRClear is not included in demo version,
-- so use HTRSubRect instead.)
HTRSubRect 6,newRect,shadowNoBorder
HTRAddRect 1,startRect,shadowNoBorder
set the rectangle of me to startRect
end mousedown</script>
</part>
<part>
<id>6</id>
<type>field</type>
<visible> <false /> </visible>
<dontWrap> <false /> </dontWrap>
<dontSearch> <true /> </dontSearch>
<sharedText> <false /> </sharedText>
<fixedLineHeight> <false /> </fixedLineHeight>
<autoTab> <false /> </autoTab>
<lockText> <true /> </lockText>
<rect>
<left>42</left>
<top>114</top>
<right>395</right>
<bottom>221</bottom>
</rect>
<style>shadow</style>
<autoSelect> <false /> </autoSelect>
<showLines> <false /> </showLines>
<wideMargins> <false /> </wideMargins>
<multipleLines> <false /> </multipleLines>
<reservedFamily> 0 </reservedFamily>
<titleWidth>0</titleWidth>
<icon>0</icon>
<textAlign>left</textAlign>
<font>Geneva</font>
<textSize>12</textSize>
<textStyle>plain</textStyle>
<textHeight>16</textHeight>
<name>PopUp</name>
<script>on mouseDown
HTRSubRect 9,the rect of me, "shadowBorder","field"
hide me
end mouseDown</script>
</part>
<part>
<id>13</id>
<type>button</type>
<visible> <true /> </visible>
<reserved5> 0 </reserved5>
<reserved4> 0 </reserved4>
<reserved3> 0 </reserved3>
<reserved2> 0 </reserved2>
<reserved1> 0 </reserved1>
<enabled> <true /> </enabled>
<rect>
<left>223</left>
<top>233</top>
<right>364</right>
<bottom>256</bottom>
</rect>
<style>shadow</style>
<showName> <true /> </showName>
<highlight> <false /> </highlight>
<autoHighlight> <false /> </autoHighlight>
<sharedHighlight> <true /> </sharedHighlight>
<family>0</family>
<titleWidth>0</titleWidth>
<icon>0</icon>
<textAlign>center</textAlign>
<font>Chicago</font>
<textSize>12</textSize>
<textStyle>plain</textStyle>
<name>Random Ugliness</name>
<script>-- There's not much point to this button but it does
-- illustrate the use of HTRForeground and HTRBackground
on mouseDown
global htxyNextcardEffect
changeColor
put the ticks + 15 into htxyNextcardEffect
end mouseDown
-- Oh, what the heck, let's cycle
on mouseStillDown
global htxyNextcardEffect
if the ticks > htxyNextcardEffect then
changeColor
put the ticks + 15 into htxyNextcardEffect
end if
end mouseStillDown
-- on mouseUp
-- changeColor
-- end mouseUp
on changeColor
-- Choose a random foreground color
put random(65535) & "," & random(65535) & "," & random(65535) into fc
-- Choose a random background color
put random(65535) & "," & random(65535) & "," & random(65535) into bc
HTRForeground 8,fc
HTRBackground 8,bc,"noDelay" -- Cause an immediate screen update
end changeColor</script>
</part>
<content>
<layer>card</layer>
<id>3</id>
<text>Movement is slow and painful, but it may be of use in special cases or on faster machines.
</text>
</content>
<content>
<layer>background</layer>
<id>10</id>
<text>Color Region Examples</text>
</content>
<content>
<layer>card</layer>
<id>6</id>
<text>I am a popup field!
Pleased to meet you!
Click on me to make me disappear.</text>
</content>
<content>
<layer>background</layer>
<id>11</id>
<text>XCMD Reference</text>
</content>
<content>
<layer>card</layer>
<id>14</id>
<text><span class="style2">he most common use of the the color region commands can be found in the ΓÇ£</span><span class="style7">on cr</span><span class="style2">ΓÇ¥ handlers throughout this stack (including this card's script). See the card ΓÇ£</span><span class="style22"><a href="#" class="group">Moving Things Around</a></span><span class="style2">ΓÇ¥ in the Notes and Tips section for an explanation of the ΓÇ£</span><span class="style7">on cr</span><span class="style2">ΓÇ¥ handler strategy. The examples below show some additional uses for changing color regions dynamically.</span></text>
</content>
<content>
<layer>background</layer>
<id>12</id>
<text>
Moving Things Around
</text>
</content>
<content>
<layer>background</layer>
<id>13</id>
<text>
5160
</text>
</content>
<name>Color Region Examples</name>
<script>on colorSetup
-- This card has a special colorSetup handler because it must allow
-- for the possibility that the user will modify the
-- screen environment while the popup field is showing
HTColorScheme the short name of this card
if the visible of card field "popup" then
HTRAddRect 9,the rect of card field "popup", "shadowBorder","field"
end if
end colorSetup
on cr
HtChangePict "none"
ClearAllRegions -- Call HTRClear for each region
HTRAddRect 1,the rect of button "Show Popup","shadowNoBorder"
HTRAddRect 1,the rect of button "Drag Me","shadowNoBorder"
HTRAddRect 1,the rect of button "Moving Button","shadowNoBorder"
HTRAddRect 8,the rect of button "Random Ugliness","shadowNoBorder"
-- Normally, we would not include color adjustments
-- in a cr handler but since we always want to
-- make region 6 have the same colors as region 1, we
-- might as well do it here.
HTRForeground 6,HTRCurrFC(1)
HTRBackground 6,HTRCurrBC(1)
-- Also I want an easy way to revert the Random Ugliness
-- button to a sane color, so let's give it the same
-- color as region 1.
HTRForeground 8,HTRCurrFC(1)
HTRBackground 8,HTRCurrBC(1)
HTWriteScheme the short name of this card
if the result is not empty then
answer "Error adjusting color layout. " & the result & "."
end if
go to this card -- Make all changes appear
end cr
on saveAsOther
-- Trap attempts to save color scheme under card name
-- and make region 6 the same as region 1
HTRForeground 6,HTRCurrFC(1)
HTRBackground 6,HTRCurrBC(1)
pass saveAsOther
end saveAsOther
-- on openCard
-- htcolorscheme the short name of this card
-- if the result is not empty then
-- answer the result
-- end if
-- end openCard
on closeCard
HTRSubRect 9,the rect of card field "popup", "shadowBorder","field"
hide card field "popup"
pass closeCard
end closeCard
</script>
</card>
card_14255.xml
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
The HTVisual command allows visual effects to occur on the next card transition or screen unlocking.
Each call to HTVisual must specify the effect parameter. All other parameters are optional. An optional parameter will be set to its default value if the parameter is not passed or (if a parameter further in the list is required) by passing the parameter as an empty string.
Multiple effects can be specified. The effects will be performed in sequence on the next card transition.
</span><span class="style2">The following effects are supported by HyperTint
</span><span class="style12">plain</span><span class="style2">: This effect causes an immediate transition, with no visual effect.</span><span class="style12">
</span><span class="style2">
</span><span class="style12">dissolve1</span><span class="style2">,</span><span class="style12"> dissolve2</span><span class="style2">,</span><span class="style12"> dissolve3</span><span class="style2">: A set of dissolve effects. Dissolve1 is the coarsest, and fastest. Dissolve3 is the finest, and slowest.
</span><span class="style12">stripes1</span><span class="style2">, </span><span class="style12">stripes2</span><span class="style2">: Dissolve effects where the transition is done in stripes.</span><span class="style12">
iris open</span><span class="style2">, </span><span class="style12">iris close</span><span class="style2">: As seen in HyperCard</span><span class="style12">
stretch from center</span><span class="style2">, </span><span class="style12">stretch from top</span><span class="style2">, </span><span class="style12">stretch from bottom</span><span class="style2">: </span><span class="style12">
</span><span class="style2"> Also as seen in HyperCard, or at least something similar.</span><span class="style12">
blend</span><span class="style2">, </span><span class="style12">slow blend</span><span class="style2">: Color dissolves. Instead of choosing which pixels in the new image get written to the screen at each step, every pixel gets displayed but each pixel makes a color transition from its old color to its new color. These effects are very slow. For full screen blends, performance is probably only acceptable on high machines such as the Quadra (and maybe not even then). On lower performance, blends can still be useful when blending small areas of the card image. For example, the ΓÇ£HyperTintΓÇ¥ title is displayed using a blend effect during this stack's opening sequence.
Remember to put the effect name in quotation marks. (Actually, this is only required for those effects, such as "wipe left", with more than one word.) Otherwise, HyperCard will get confused.
</span><span class="style2">Visual effects, be default, make a transition to the new card image. Visual effects can also make a transition to a color.
</span><span class="style9">
</span><span class="style2">The </span><span class="style22"><a href="#" class="group">color parameter</a></span><span class="style2"> is a list of three integers (0-65535), separated by commas. Each number specifies the amount of the three color components: red, green, and blue.
Instead of specifying the three color components, the following keywords can also be specified: </span><span class="style12">white</span><span class="style2">, </span><span class="style12">black</span><span class="style2">, </span><span class="style12">gray</span><span class="style2">, </span><span class="style12">light gray</span><span class="style2">, </span><span class="style12">dark gray</span><span class="style2">.
The color parameter can also be passed as </span><span class="style12">card</span><span class="style2">, which will perform a transition to the new card image. This is equivalent to the case where a color is not specified.
</span><span class="style2">By default, the visual effect will take place over the entire display area that is being updated. When moving between cards or unlocking the screen, the area being updated would be the entire card image.
A script can choose to restrict the effect to a smaller rectangle by passing a rectangle parameter. This can be done to make the slower visual effects more efficient or to cause different sections of the card to have different transitions.
</span><span class="style21">Delay and increment parameters
</span><span class="style2">
The delay and increment parameters allow fine tuning of the visual effects. By default, these parameters will be set to reasonable values. Adjusting this values allows control of the speed and quality of the visual effect. They are HyperTint's equivalents to HyperCard's visual effect speed modifiers ("fast", "very slow", etc.)
The delay parameter controls how fast successive ΓÇ£stepsΓÇ¥ in the visual effect will occur. It specifies the number of ticks (60 ticks = 1 second) between the start of one step and the start of the next step. If, when running on a slower Macintosh model, HyperTint cannot keep up with the rate specified, HyperTint does the steps just as fast as it can. Specifying a delay parameter of 0 means ΓÇ£go as fast as possible,ΓÇ¥ no matter which Mac model is being used.
The increment parameter controls the ΓÇ£smoothnessΓÇ¥ of each step. Depending on its value, it only effects certain visual effects. It can be set to </span><span class="style12">smooth</span><span class="style2"> or to </span><span class="style12">4</span><span class="style2">, </span><span class="style12">8</span><span class="style2">, </span><span class="style12">16</span><span class="style2">, </span><span class="style12">32</span><span class="style2">, or </span><span class="style12">64</span><span class="style2">. Any other numbers will be rejected.
Setting the parameter to </span><span class="style12">smooth</span><span class="style2"> affects only the dissolve effects (</span><span class="style12">dissolve1</span><span class="style2">,</span><span class="style12"> dissolve2</span><span class="style2">,</span><span class="style12"> dissolve3</span><span class="style2">, </span><span class="style12">stripes1</span><span class="style2">, </span><span class="style12">stripes2</span><span class="style2">). Without the smooth parameter, the dissolve effects ΓÇ£sweepΓÇ¥ down the card when moving between cards. This sweeping does not seem to be a problem when the cards share a similar background: for instance, if large areas of each card are the same shade of gray. When dissolving between cards that have substantially different images or dissolving to a solid color, this sweeping becomes quite noticeable. The </span><span class="style12">smooth</span><span class="style2"> parameter eliminates this sweeping effect. The effect actually takes significantly longer ΓÇö with the speed penalty increasing with each additional color region being used ΓÇö but the updates to the screen occur quicker. This ΓÇ£smoothnessΓÇ¥ may be useful in some cases, particularly if there are not many color regions being used.
iris open</span><span class="style2">, </span><span class="style12">iris close</span><span class="style2">,</span><span class="style12"> stretch from center</span><span class="style2">, </span><span class="style12">stretch from top</span><span class="style2">, and </span><span class="style12">stretch from bottom </span><span class="style2">visual effects. For the scrolls and wipes, the meaning of the increment parameter is straightforward: it controls how many pixels the incoming image will move on each step. For the stretch and iris effects, the relationship is less straightforward, but smaller increment values mean ΓÇ£finer and slowerΓÇ¥ while larger values mean ΓÇ£coarser and faster.ΓÇ¥
The delay and increment parameters work together to produce the best effect. Short delays look best when teamed with larger increments. For slower effects, specifying smaller increments will make the effect appear smoother. Of course, if it is known that the stack will be run only on Quadras, small increments can be used for all effects, for the ultimate in visual comfort.
In addition to its normal choice of parameters, HTVisual has some additional options to handle special cases. In these cases, HTVisual is called with a single keyword parameter: </span><span class="style12">allow</span><span class="style2">, </span><span class="style12">disallow</span><span class="style2">, or </span><span class="style12">anyUpdate</span><span class="style2">.
The </span><span class="style12">allow</span><span class="style2"> and </span><span class="style12">disallow</span><span class="style2"> keywords act as a master switch. If the command </span><span class="style7">HTVisual "disallow"</span><span class="style2"> is included in a script, all calls to HTVisual will have no effect. All visual effects are turned off. The command </span><span class="style7">HTVisual "allow"</span><span class="style2"> can be used to turn visual effects back on, if desired. These two versions of the HTVisual command are provided as a convenience to the scripter who is trying to adapt to low memory conditions. If there is not enough memory available to create HyperTint's offscreen buffers with the same depth as the screen, an advanced scripter may choose to try </span><span class="style22"><a href="#" class="group">installing at a lower pixel depth</a></span><span class="style2">. The memory requirements are reduced at the cost of aesthetic beauty and speed. One place where the speed penalty is particularly high is during visual effects, because the penalty occurs at each ΓÇ£stepΓÇ¥ of the visual effect. The scripter may want to disable visual effects if it was necessary to install HyperTint in a memory-saving time-chewing configuration. A single </span><span class="style7">HTVisual "disallow"</span><span class="style2"> in the handler doing the HyperTint installation will turn off all visual effects for the stack. If this special option was unavailable, the scripter would have to set a global variable and include extra code before every HTVisual call to check this variable.
</span><span class="style12">AnyUpdate</span><span class="style2"> is a very specialized, advanced option. Don't worry about it. On the other hand, if you insist on knowing …
Normally, visual effects should occur when HyperCard moves to the next card or when the screen is unlocked. This is HyperTint's default behaviour. Under some cases, it may be desirable to have the visual effects occur the next time HyperCard writes something to the screen. Including the command </span><span class="style7">HTVisual "anyUpdate"</span><span class="style2"> will cause all pending visual effects to occur on the next screen update, no matter how much or how little of the screen is being updated. This might be useful if you want to have </span><span class="style22"><a href="#" class="group">a visual effect when making a button or field visible</a></span><span class="style2"> (without having to lock and unlock the screen).
[When the </span><span class="style12">anyUpdate</span><span class="style2"> option is used, the default rectangle for all effects is the rectangle that is being updated, rather than the card rectangle. This default rectangle might be, for instance, the bounding rectangle of the field or button being displayed. It is dependent on how HyperCard chooses to refresh the screen image.]
If the command was successful, HyperCard's </span><span class="style7">the result</span><span class="style2"> function will return an empty string. Other possible results are:
"Not Installed": HyperTint is not installed in the current stack.
"Too many effects": Only 15 visual effects can be pending.
"Bad Speed": The speed parameter is not a number or it's so large that HyperTint figures there must be a mistake.
"Bad increment": The increment parameter was not a valid choice.
"Bad Color": HyperTint could not make sense of the color parameter.
"Bad Rectangle": HyperTint could not make sense of the rectangle parameter.
<text>Additional Cards in Documentation Stack</text>
</content>
<content>
<layer>background</layer>
<id>6</id>
<text><span class="style2">he full version of the HyperTint documentation stack cover the following additional topics in the ΓÇ£XCMD ReferenceΓÇ¥ section.
A function that determines the current screen bit depth which indicates the number of available colors.
</span><span class="style9">HTCurrFC XFCN
HTCurrBC XFCN
HTRCurrFC XFCN
HTRCurrBC XFCN
</span><span class="style2">
A set of utility functions that return the current default foreground or background color or the current foreground and background color for any of the color regions.</span></text>
</content>
<content>
<layer>background</layer>
<id>10</id>
<text>XCMD Reference</text>
</content>
<name>Additional Cards in Docum</name>
<script></script>
</card>
card_8686.xml
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
<text><span class="style2">he biggest limitation of HyperTint is that it cannot detect when a button or a field is moved. Scripting commands must be made to update the areas assigned to each color region. This can a nuisance during stack authoring, but there is an approach that reduces the nuisance factor down to its absolute minimum. Using this technique, updating the color scheme to match the new card layout can be as fast as typing a two letter command into the message box.
This discussion assumes that all the cards in the same background share same the color layout changes, and that layout changes from background to background. (The same ideas apply to stacks where every card, or just some cards, have their individual color layouts, except that </span><span class="style7">openCard</span><span class="style2"> handlers may be used to override the default actions for that background.)
This discussion will also assume that each </span><span class="style7">openBackground</span><span class="style2"> handler is using </span><span class="style12">HTColorScheme</span><span class="style2"> to initialize the color layout. Using color schemes makes interactive changes much easier. Because the color layout is being changed on a background by background basis, we might as well store each scheme under the name of this background. Each </span><span class="style7">openBackground</span><span class="style2"> handler would include the line
</span><span class="style10"> HTColorScheme the short name of this background</span><span class="style2">
This would read the color scheme from a resource whose name matches the background name.
The basic technique to adapt to moving objects is to use a script handler whose sole job is to initialize the various color regions that are used. Give the handler a nice short name, perhaps </span><span class="style7">cr</span><span class="style2"> (for ΓÇ£color regionsΓÇ¥). This makes it quick to type the handler name into the message box. The handler's sole job is to assign the areas of the screen for each color region. For instance, a cr handler for this background might look this
</span><span class="style10"> on cr
-- Assign the color regions for this background. This
-- background uses three color regions.
--
-- The first step is to clear out the three regions used.
-- Otherwise, the old object locations will be kept in the
-- region along with the new locations.
HTRClear 1
HTRClear 2
HTRClear 3
-- Now, add the new locations to the empty regions
HTRAddRect 1,the rect of field "Doc", "noScroll"
HTRAddRect 2,the rect of field "Title"
HTRAddRect 3, the rect of bg button "GoLeft",¬
the rect of bg button "GoRight"
-- The above commands have changed the current color layout
-- but to make these changes permanent, they are saved
-- in the color scheme for this background, so that the
-- time this background is "opened", the new layout will
-- be found.
HTWriteScheme the short name of this background
if the result is not empty then
answer "Error saving new color scheme: " & the result
end if
end cr
</span><span class="style2">
Now, after moving a field or button around, typing cr into the message box will quickly update the color scheme and make sure that the changes will automatically be saved.
The only time you need to edit the script is when you want to change which buttons or field belong to which region.
</span><span class="style12">Demo note: all the </span><span class="style29">cr</span><span class="style12"> message handlers have been left in the scripts of this demo version ΓÇö so that they can examined ΓÇö but most will not work with the demo version of HyperTint. First, the </span><span class="style29">cr</span><span class="style12"> handlers use the HTWriteScheme XCMD to save the new color layout: HTWriteScheme is not included in this demo. Second, for the XCMDs that are included with the demo, the </span><span class="style29">cr</span><span class="style12"> handlers may try to use options that are not supported: options that are not required for run-time support of the HyperTint demo have been stripped out of the XCMDs.
</span><span class="style2">
Notice that the handler doesn't make any attempt to set the foreground and background colors for each region. When using color schemes, HyperTint provides a interactive way to change the color assigned to different regions, as described in the next card.</span></text>
</content>
<content>
<layer>background</layer>
<id>8</id>
<text>
</text>
</content>
<content>
<layer>background</layer>
<id>9</id>
<text>
</text>
</content>
<content>
<layer>background</layer>
<id>10</id>
<text>Notes and Tips</text>
</content>
<name>Moving Things Around</name>
<script></script>
</card>
card_15926.xml
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
<text><span class="style2">ndless hours can be spent on selecting "just the right colors" for a layout. Changing the color for a region is quite annoying when you have to open the script editor, figure out (perhaps by </span><span class="style12">HTUPickColor</span><span class="style2">) the red, green, and blue components for the desired color, and change the parameters in the </span><span class="style12">HTRForeground</span><span class="style2"> or </span><span class="style12">HTRBackground</span><span class="style2"> commands.
To ease this task, a button panel palette has been provided that allows quickly selecting new colors for each of the color region, as well as the default foreground and background colors.
This stack has a handler that will display the palette. The handler can be invoked by typing ΓÇ£ccΓÇ¥ into the message box.
There is a button on the palette for each color region. Clicking on a button is used to change the background color. Shift-clicking is used to change the foreground color. For both cases, the ΓÇ£choose colorΓÇ¥ dialog box is displayed. Option-clicking on a region number presents the option of making the region's background transparent or set to the default background color.
The default colors can also be set: click on the ΓÇ£DefaultΓÇ£ button to set the default background color; shift-click to set the default foreground color. Option-Clicking has no meaning for the default button.
The ΓÇ£Save under Bkgnd NameΓÇ¥ and "Save as ..." are used to support color schemes. Clicking ΓÇ£Save under Bkgnd NameΓÇ¥ will save the current colors, along with all other characteristics of the color layout (backdrop picture, areas of the card assigned to each region) under a color scheme resource whose matches the short name of the current background. This is useful for stacks where the color scheme changes on a background by background basis. For other color scheme strategies ΓÇö or to make a temporary copy of a color scheme ΓÇö the ΓÇ£Save as ...ΓÇ¥ button can be used to save a color scheme under any name. </span><span class="style12">Demo note: saving a color scheme requires the HTWriteScheme XCMD which is not included in this demo.</span><span class="style2">
The button panel uses scripts that are contained in this stack. In order to use the panel in other stacks, this stack must first be inserted into message hierarchy. This can be done by using the command </span><span class="style7">start using stack "HyperTint"</span><span class="style2">. This command can be typed into the message box each time or this command could be included, during a stack's authoring stage, in the stack's </span><span class="style7">openStack</span><span class="style2"> handler. </span><span class="style12">Demo note: the version of HyperTint included in this demo will not work in other stacks.</span><span class="style2">
</span></text>
</content>
<content>
<layer>background</layer>
<id>8</id>
<text>
</text>
</content>
<content>
<layer>background</layer>
<id>9</id>
<text>
</text>
</content>
<content>
<layer>background</layer>
<id>10</id>
<text>Notes and Tips</text>
</content>
<name>Assigning Colors Interact</name>
<script>on openCard
global htxxCCWasThere
send openCard to this background
put (there is a window "HT Color Panel") into htxxCCWasThere
cc -- call our handler to open the button color panel
-- pass opencard
end openCard
on closeCard
global htxxCCWasThere
-- If the button color panel wasn't there when we opened
-- this card, get rid of it again. (Be careful: the user
-- may have already closed the window.)
if not htxxCCWasThere and there is a window "HT Color Panel" then
close window "HT Color Panel"
end if
pass closeCard
end closeCard
</script>
</card>
card_26670.xml
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
<text><span class="style2">here are still some remnants of the black and white world when using HyperTint.
ΓÇó The dialog box that is displayed by the ΓÇ£Go RecentΓÇ¥ menu displays black and white thumbnail card images.
ΓÇó All printing is still black and white.
• The “Export Paint…” menu item exports HyperCard's black and white image.
ΓÇó Card images that are copied to the clipboard are black and white.
ΓÇó The command </span><span class="style7">show cards</span><span class="style2"> will display in color, but because system messages are not sent while the </span><span class="style7">show cards</span><span class="style2"> command is running, the colors will be ΓÇ£all messed upΓÇ¥ when HyperCard flips to a card that is supposed to have a different color layout. To flip through cards with differing color layouts, one of the </span><span class="style22"><a href="#" class="group">following commands</a></span><span class="style2"> could be substituted for the show cards command, although the card flipping speed will be slower.
</span><span class="style10">
on ShowCards
repeat
if the mouseClick then exit repeat
go next card
end repeat
end ShowCards
on ShowAllCards
repeat for the number of cards
if the mouseClick then exit repeat
go next card
end repeat
end ShowAllCards
</span><span class="style2">If all cards being shown share the same color layout, then it is okay to directly use the </span><span class="style26"><a href="#" class="group">show cards</a></span><span class="style2"> command.</span></text>
</content>
<content>
<layer>background</layer>
<id>10</id>
<text>Notes and Tips</text>
</content>
<content>
<layer>background</layer>
<id>8</id>
<text>
show cards
following commands
</text>
</content>
<content>
<layer>background</layer>
<id>9</id>
<text>
S demoFastShow
S demoSlowShow
</text>
</content>
<name>What Stays Black and Whit</name>
<script>on demoFastShow
-- This handler is used to demonstrate card flipping when it
-- is known that the color layouts stay the same.
-- Remember where we were
put the scroll of field "Doc" into saveScroll
push card
go card "HyperTint Features"
-- The next 8 cards all share the same color layout
show 8 cards
pop card
end demoFastShow
on demoSlowShow
-- This handler is used to demonstrate card flipping when it
-- is known that the color layouts stay the same.
-- Remember where we were
put the scroll of field "Doc" into saveScroll
push card
-- The stack of this section would show a few section
-- header cards followed by a some of the cards in this
-- background
go card "Notes and Tips"
repeat 8 times -- (8 should be enough cards to show the idea.)
if the mouseClick then exit repeat
go next card
end repeat
pop card
end demoSlowShow</script>
</card>
card_25328.xml
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
<text><span class="style2">he memory requirements of HyperTint can be reduced by several methods
ΓÇó use a smaller card size
ΓÇó leave out the color backdrop picture
ΓÇó install HyperTint at a shallower pixel depth
ΓÇó ask the user to change the monitor setting to a
shallower pixel depth
The standard memory requirement for HyperTint is
(((pixel depth of deepest screen) * 2 + 1)
* cardHeight * cardWidth) /8
This stack is 448 pixels wide and 280 pixels tall. The memory required for buffers to display this stack on a 256-color (8 bit) monitor would be
(((8) * 2 +1) * 280 * 448) / 8
which is about 270 kilobytes. This does not include the memory that is needed to read in picture resources and the memory temporarily used by QuickDraw when drawing a new picture. The size of the picture resource might vary from about ten up to hundreds of kilobytes, depending on how much compression QuickDraw was able to perform on the images. When drawing a bitmapped picture (that is, a scanned image or a picture produced by a "paint" program), QuickDraw allocates an additional offscreen image buffer to hold the bitmap. The good news is that the HyperCard 2.x programming team seems to have done a good job with memory management issues: HyperCard is quite gracious in handling the temporary requests for oodles of memory when changing pictures.
To reduce memory requirements, various actions can be taken. One is to use smaller card sizes. The memory needed for offscreen buffers decreases proportionally to the number of pixels displayed on a card. The obvious disadvantage is that less information can be displayed on each card.
Another memory reduction technique is to use the colorization features without a backdrop picture. In this case, the memory required for offscreen buffers decreases to approximately
For a stack that's 448 pixels wide and 280 pixels tall, this would reduce the memory requirements for the offscreen buffers to about 140K. (This assumes the deepest screen supports 256 colors: a pixel depth of 8.) To install HyperTint without a backdrop picture, use the keyword </span><span class="style12">none</span><span class="style2"> as the picture specifier when calling the </span><span class="style1"><a href="#" class="group">HyperTint</a></span><span class="style2"> command.
It is possible to create the offscreen buffers with a shallower depth than the screen. For instance, specifying a pixel depth of 4 would limit the choice of colors to 16 but would reduce the memory requirements for a 448x280 screen to about 140K for a stack with a backdrop picture and about 80K for a stack without a backdrop. (Actually, when considering these lower memory requirements, you should also add in a fixed overhead of about 40K that is unrelated to card size or screen/buffer depth. The depth of the offscreen buffers can be controlled by specifying the optional keywords </span><span class="style12">maxDepth1</span><span class="style2">, </span><span class="style12">maxDepth2</span><span class="style2">, </span><span class="style12">maxDepth4</span><span class="style2">, </span><span class="style12">maxDepth8</span><span class="style2">, </span><span class="style12">maxDepth16</span><span class="style2">, or </span><span class="style12">maxDepth32</span><span class="style2">, when calling the </span><span class="style22"><a href="#" class="group">HyperTint</a></span><span class="style2"> command.
Reducing the pixel depth of the offscreen buffers causes a dramatic speed penalty. For many uses, this would make this option too slow to be usable. In particular, visual effects slow down greatly, because the effects take the performance hit several times each time the effect is done. For those stacks where the performance penalty may be acceptable for everything but the visual effects, </span><span class="style1"><a href="#" class="group">HTVisual</a></span><span class="style2"> allows a "master switch" ΓÇö using the keywords </span><span class="style12">allow</span><span class="style2"> and </span><span class="style12">disallow</span><span class="style2"> ΓÇö that turns on and off all visual effects. This makes it easier to create a stack that would only use a restricted pixel depth if there was not enough memory for the faster version with a pixel depth matching the screen: all visual effects could be turned off when opening the stack under low memory conditions, without having to put checks before every call to </span><span class="style1"><a href="#" class="group">HTVisual</a></span><span class="style2">.
Given the enormous memory requirements for 32-bit color screens, it may be best to always specify a maximum pixel depth of 8 bits when invoking HyperTint. The speed penalty when drawing from an 8-bit offscreen buffer to a 32-bit screen seems to be less than the speed penalty of drawing from a 4-bit buffer to an 8-bit screen.
For 32-bit color screens, this stack will attempt to install HyperTint at a depth of 32 bits, but if there is not enough memory, this stack will install HyperTint at an 8 bit depth and turn off visual effects. This is described further on the card ΓÇ£This Stack: Installing HyperTint.ΓÇ¥
The best way to handle lower memory conditions, assuming your colorized images will still look acceptable at the lower pixel depth, is to ask the user to use the Monitors panel to select a shallower pixel depth before opening your stack. That way, there would be no speed penalty. (Indeed, the shallower pixel depth should make HyperTint faster.)
</span></text>
</content>
<content>
<layer>background</layer>
<id>10</id>
<text>Notes and Tips</text>
</content>
<content>
<layer>background</layer>
<id>8</id>
<text>
HyperTint
HTVisual
</text>
</content>
<content>
<layer>background</layer>
<id>9</id>
<text>
3747
14255
</text>
</content>
<name>Reducing Memory Requireme</name>
<script></script>
</card>
card_17922.xml
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
<text>Compatibility with Future HyperCard Versions</text>
</content>
<content>
<layer>background</layer>
<id>6</id>
<text>I think most people would agree that a future version of HyperCard likely will increase its built-in support of color. The impact of this on stacks using HyperTint is difficult to predict.
HyperCard 2.0/2.1 makes use of an offscreen buffer that keeps a copy of the card image. That is why scrolling with the scroll windoid provides such fast response. If future versions continue to use this offscreen buffer ΓÇö but change the buffers from black-and-white to color ΓÇö HyperTint has a good chance of continuing to work. HyperTint has been tried in a color environment, but testing so far has been minimal so problems may still remain.
Still, it is not clear that future versions will continue to use an offscreen buffer. The technique provides a fast way of updating the card window display, but for color support, the amount of memory required may be too great. The amount of memory required for the offscreen buffer gets especially large if support is included for 24-bit color paint. It is difficult to predict the decisions of Claris' programming team, so a compatibility risk is there.
Trivia note: FoxBASE+/Mac was used for color testing because it employs a similar screen refresh technique, but testing was restricted because FoxBASE doesn't support the HyperCard 2.x XCMD programming interface, which HyperTint requires.</text>
</content>
<content>
<layer>background</layer>
<id>10</id>
<text>Notes and Tips</text>
</content>
<name>Compatibility with Future</name>
<script></script>
</card>
card_6295.xml
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
<text>Additional Cards in Documentation Stack</text>
</content>
<content>
<layer>background</layer>
<id>6</id>
<text><span class="style2">he full version of the HyperTint documentation stack cover the following additional topics in the ΓÇ£Notes and TipsΓÇ¥ section.
</span><span class="style9">Colors: Not always what you expect</span><span class="style2">
This card just points out that when dealing with system with 256 or fewer colors, colors get translated to the nearest available color, rather than exactly matching the color specifier that is passed to the command.
This card discusses the use of HyperCard's </span><span class="style7">the result</span><span class="style2"> function to find errors: both ΓÇ£typosΓÇ¥ during development and insufficient memory errors during ΓÇ£run-time.ΓÇ¥
</span><span class="style9">Locking the Screen Before Making Changes</span><span class="style2">
This card points out that, when moving between cards with different color schemes, the screen should be locked before leaving the first card and unlocked after arriving at the second card. This gives HyperTint a chance to change the color scheme before HyperCard updates the card image.
</span><span class="style9">Colorizing Black and White Fields</span><span class="style2">
This card provides the tip that, even for a field that is left as black and white, typing and scrolling performance will be improved if the field is assigned to a color region. (The color region will use black as the foreground color and white as the background color.)
</span><span class="style9">Turning HyperTint off for Background Stacks</span><span class="style2">
This card discusses how, if it is desired to free up the memory used by HyperTint, a stack can remove HyperTint when the stack is switched to the background.
</span><span class="style9">Peaceful Coexistence with Black and White Systems</span><span class="style2">
This card discusses a few techniques that can be used when developing stacks that must run on both color and black and white systems.
</span><span class="style9">Enough Memory to Install?</span><span class="style2">
Gives an example script that will install HyperTint and then check that enough memory remains for HyperCard to function properly.
</span><span class="style9">Changing Color Depth</span><span class="style2">
HyperTint does not automatically detect changes in the color environment: for instance, when a user uses the Monitors control panel to change the number of colors or drags the stack's window to another screen. This card discusses handlers that can be added to a stack to detect the most common changes in the color environment and reinstall HyperTint to match the new screen settings.
This demo stack uses these handlers to adapt to changes in screen settings.
</span><span class="style9">Most Commands Don't Update the Screen</span><span class="style2">
This card points out that many of the HyperTint commands, by default, do not cause an immediate screen update. This makes it easier for a script to implement popup fields and similar features. This card also discusses the </span><span class="style12">noDelay</span><span class="style2"> keyword which can be used in the few cases where immediate updates are desired.
</span><span class="style9">Layering of HyperTint Color Regions</span><span class="style2">
When implementing popup fields (or moving buttons), it is important that the popping field be assigned to a higher-numbered color region than any of the color regions it will obscured when popped up.
</span><span class="style9">Clear Regions When No Longer Needed</span><span class="style2">
This card discusses that color regions should be cleared when leaving a card/background that used them. Forgetting to clear a region will leave the region active, which will look strange because the next card probably will have colorized sections that don't match the fields and buttons on the card. Stacks that exclusively use the HTColorScheme command to chnage color layouts do not have to worry about thisd problem; HTColorScheme automatically clears unused color regions.
</span><span class="style9">Installing the HyperTint Externals</span><span class="style2">
Discusses how to use ResEdit, ResCopy 2.0, or the Resource Mover card to install the HyperTint XCMDs and XFCNs into a stack.
</span><span class="style9">Creating and Installing Picture Resources</span><span class="style2">
Discusses how a PICT resource can be created by copying a picture to the Scrapbook and then using ResEdit, ResCopy 2.0, or the Resource Mover card to copy the PICT resource into a stack from the Scrapbook File.
Points out that the HTWriteScheme XCMD assumes that the current stack already has a resource fork. Discusses one trick that causes HyperCard to create a resource fork for a stack.
</span><span class="style9">Compatibility with AddMotion</span><span class="style2">
This card discusses the HTXBury XFCN and the HTXDigup XCMD will have been included as a way to provide compatibility with AddMotion, the HyperCard animation add-in from Motion Works.
</span><span class="style2">These cards discuss the scripts and global variables used to support color in the HyperTint stack. These provide an example of the techniques described on other cards in the ΓÇ£Notes and TipsΓÇ¥ section.
This demo version uses the same scripts as in the full HyperTint documentation stack.
</span></text>
</content>
<content>
<layer>background</layer>
<id>10</id>
<text>Notes and Tips</text>
</content>
<name>Additional Cards in Docum</name>
<script></script>
</card>
card_18735.xml
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
<text><span class="style11"></span><span class="style2"> HyperTint was created by Symplex Systems.
</span></text>
</content>
<content>
<layer>card</layer>
<id>5</id>
<text>I am only on AppleLink a few times a month. If you want to reach me quickly from AppleLink, address the message to "a347@mindlink.UUCP@internet#". This will send it to my usenet mail address.
</text>
</content>
<content>
<layer>card</layer>
<id>7</id>
<text><span class="style11">his section of the stack will be changed based on the desired information about Heizer, if Heizer is interested in distributing the stack. The emulation of a IBM computer display will be replaced with a more eye-friendly color scheme.</span></text>
</content>
<content>
<layer>background</layer>
<id>7</id>
<text>About HyperTint</text>
</content>
<name>About HyperTint</name>
<script>-- on closeCard
-- HTRClear 7
-- hide card field "Heizer Note"
-- pass closeCard
-- end closeCard
-- on openCard
-- send openCard to this background
-- HTRAddRect 7,the rect of card field "Note","shadownoBorder","field"
-- HTRBackground 7,"White" -- (I'm too lazy to edit the color scheme today)
-- show card field "Note"
-- end openCard
on markCardMenu
-- We want this card treated as a "section header", so no
-- checkmark should be applied.
end MarkCardMenu
</script>
</card>
card_18200.xml
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
Symplex Systems provides a variety of Macintosh programming and consulting services. Consider Symplex for innovative solutions.
</span><span class="style2">
</span><span class="style11"> ΓÇó Macintosh consulting and software development
ΓÇó C, Pascal, C++, Assembly language
ΓÇó HyperCard, SuperCard, XCMDs & XFCNs
ΓÇó FoxBASE
ΓÇó Spreadsheets, databases, and stuff
ΓÇó AutoCAD (MS-DOS)
</span></text>
</content>
<content>
<layer>card</layer>
<id>5</id>
<text>I am only on AppleLink a few times a month. If you want to reach me quickly from AppleLink, address the message to "a347@mindlink.UUCP@internet#". This will send it to my usenet mail address.
</text>
</content>
<content>
<layer>background</layer>
<id>7</id>
<text>About HyperTint</text>
</content>
<name>Symplex Systems</name>
<script></script>
</card>
card_25926.xml
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
<text><span class="style2"></span><span class="style11">HyperTint costs US$35 per single-CPU copy. The next card contains an order form which can be mailed, with check or money order, to Symplex Systems.
Buyers will receive a disk containing the full HyperTint documentation stack and the externals with all options enabled. Technical support is provided to buyers, either by telephone or by electronic mail on AppleLink or the Internet. The Internet e-mail address is also accessible from CompuServe, and possibly other commercial electronic services.
A 75-page printed manual, containing the same information as the documentation stack, is available at an additional charge.
A license is available from Symplex Systems for distribution of the HyperTint externals in a stack.</span></text>
</content>
<content>
<layer>background</layer>
<id>7</id>
<text>About HyperTint</text>
</content>
<name>Ordering Info </name>
<script></script>
</card>
card_23519.xml
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
<text><span class="style2">lease read this license agreement before mailing your order form. It lists the terms of the agreement between you, the licensee, and Symplex Systems. It is assumed that, if you order HyperTint, you find these terms acceptable.
</span><span class="style11">
</span><span class="style2">The single CPU license for HyperTint allows running on a single computer. Running HyperTint on additional computers require additional licenses to be purchased. Distribution of the HyperTint externals within a stack requires a separate distribution license from Symplex Systems.
</span><span class="style11">
</span><span class="style2">You recognize that the HyperTint externals go beyond the bounds of the standard HyperCard XCMD interface. Because of the nature of the software, Symplex System cannot guarantee that HyperTint will be compatible with future versions of HyperCard or with future versions of Macintosh system software. It is your responsibility to test HyperTint in your application to determine that HyperTint performs correctly and is suitable.
</span><span class="style11">
</span><span class="style2">UNDER NO CIRCUMSTANCES, INCLUDING NEGLIGENCE, SHALL SYMPLEX
SYSTEMS OR ITS EMPLOYEES BE LIABLE FOR ANY INCIDENTAL, SPECIAL
OR CONSEQUENTIAL DAMAGES THAT RESULT FROM THE USE OR
INABILITY TO USE THE SOFTWARE OR RELATED SOFTWARE, EVEN IF
SYMPLEX SYSTEMS HAS BEEN ADVISED OF THE POSSIBILITY OF THE SUCH DAMAGES. SOME STATES DO NOT ALLOW THE LIMITATION OR
EXCLUSION OF LIABILITY FOR INCIDENTAL OR CONSEQUENTIAL
DAMAGES SO THE ABOVE LIMITATION OR EXCLUSION MAY NOT APPLY
TO YOU. In no event shall Symplex Systems' total liability to you
for all damages, losses, and causes of action (whether in contract,
tort, (including negligence) or otherwise) exceed the amount paid
by you for HyperTint.
</span><span class="style11">
You may transfer your license to another person as long as that person has read this license and agrees to its terms, and all copies of the HyperTint stack and the HyperTint externals either are transferred to the new licensee or are destroyed. In order for the new licensee to receive technical support, Symplex Systems must be given the name and address information for both the original licensee and the new licensee.
</span><span class="style2">Nothing in this license places any restrictions on Symplex Systems selling or giving away the HyperTint externals to other parties, in whatever form Symplex desires.